A First-Order Theory of Types and Polymorphism in Logic Programming
نویسندگان
چکیده
We describe a new logic called typed predicate calculus (T PC) that gives declarative meaning to logic programs with type declarations and type inference. T PC supports all popular types of polymorphism, such as parametric, inclusion, and ad hoc polymorphism. The proper interaction between parametric and inclusion varieties of polymorphism is achieved through a new construct, called type dependency, which is reminiscent of implication types of PR89] but yields more natural and succinct speciications. Unlike other proposals where typing has extra-logical status, in T PC the notion of type-correctness has precise model-theoretic meaning that is independent of any speciic type-checking or type-inference procedure. Moreover, many diierent approaches to typing that were proposed in the past can be studied and compared within the framework of our logic. As an illustration, we apply T PC to interpret and compare the results reported in MO84, Smo88, HT90, Mis84, XW88]. Another novel feature of T PC is its reeexivity with respect to type declarations; namely, in T PC these declarations can be queried the same way as any other data. This should be contrasted with other proposals where typing is part of meta-speciications about the program, inaccessible from within the program. Type reeexivity is useful for browsing knowledge bases and, potentially, for debugging logic programs.
منابع مشابه
Beyond first order logic: From number of structures to structure of numbers: Part II
We study the history and recent developments in nonelementarymodel theory focusing on the framework of abstractelementary classes. We discuss the role of syntax and semanticsand the motivation to generalize first order model theory to nonelementaryframeworks and illuminate the study with concrete examplesof classes of models. This second part continues to study the question of catecoricitytrans...
متن کاملBeyond First Order Logic: From number of structures to structure of numbers: Part I
We study the history and recent developments in nonelementarymodel theory focusing on the framework of abstractelementary classes. We discuss the role of syntax and semanticsand the motivation to generalize first order model theory to nonelementaryframeworks and illuminate the study with concrete examplesof classes of models. This first part introduces the main conceps and philosophies anddiscu...
متن کاملNurse rostering using fuzzy logic: A case study
In this paper, we used the fuzzy set theory for modeling flexible constraints and uncertain data in nurse scheduling problems and proposed a fuzzy linear model for nurse rostering problems. The developed model can produce rosters that satisfy hospital objectives, ward requirements and staff preferences by satisfying their requests as much as possible. Fuzzy sets are used for modeling demands of...
متن کاملHoare type theory, polymorphism and separation
We consider the problem of reconciling a dependently typed functional language with imperative features such as mutable higher-order state, pointer aliasing, and non-termination. We propose Hoare Type Theory (HTT), which incorporates Hoare-style specifications into types, making it possible to statically track and enforce correct use of side effects. The main feature of HTT is the Hoare type {P...
متن کاملOptimizing the Runtime Processing of Types in a Higher-Order Logic Programming Language
The traditional purpose of types in programming languages of providing correctness assurances at compile time is increasingly being supplemented by a direct role for them in the computational process. In the specific context of typed logic programming, this is manifest in their effect on the unification operation. Their influence takes two different forms. First, in a situation where polymorphi...
متن کامل